#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#

(progn ;;init forms
  (ros:ensure-asdf)
  #+quicklisp(ql:quickload '(:lilu-desk
                             :lilu-my-dot)
                           :silent t))

(defpackage :ros.script.lilu-eval.3841839401
  (:use :cl))
(in-package :ros.script.lilu-eval.3841839401)

(opts:define-opts
  #.lilu-roswell:*default-help-option*
  #.lilu-roswell:*default-debugger-option*)

(defun main (&rest argv)
  (lilu-roswell:init)
  (multiple-value-bind (options free-args)
      (lilu-roswell:parse-options argv
                                  :free-args-p nil)
    (declare (ignorable free-args))
    (lilu-roswell:options-check-for-help options
                                         :prefix nil
                                         :suffix nil
                                         :usage-of "lilu-eval.ros"
                                         :args     "S-EXP ...")
    (lilu-debugger:with-debugger
        ((lilu-roswell:options-get-value options :debugger))
      (uiop:run-program (format nil "cp -r ~A/* ~~/.lilu/" (asdf:system-relative-pathname 'lilu-my-dot "./dot-lilu"))
                        :force-shell t)
      (lilu-config:register-system-config-directories)
      (dolist (cf (lilu-config:find-system-config-files "./bin/"))
        (let ((cmd (format nil "cp ~A ~~/.lilu/bin/" cf)))
          (format *debug-io* "=> ~A~%" cmd)
          (uiop:run-program cmd :force-shell t))))))

;;; vim: set ft=lisp lisp:
